import request from "@/utils/request";

// 查询考勤打卡列表
export function listAttendance(query) {
  return request({
    url: "/cld/attendance/list",
    method: "get",
    params: query,
  });
}

// 查询考勤打卡详细
export function getAttendance(attendanceId) {
  return request({
    url: "/cld/attendance/" + attendanceId,
    method: "get",
  });
}

// 新增考勤打卡
export function addAttendance(data) {
  return request({
    url: "/cld/attendance",
    method: "post",
    data: data,
  });
}

// 修改考勤打卡
export function updateAttendance(data) {
  return request({
    url: "/cld/attendance",
    method: "put",
    data: data,
  });
}

// 批量修改考勤打卡
export function batchUpdateAttendance(list) {
  return request({
    url: "/cld/attendance/batchUpdateAttendance",
    method: "put",
    data: list,
  });
}

// 删除考勤打卡
export function delAttendance(attendanceId) {
  return request({
    url: "/cld/attendance/" + attendanceId,
    method: "delete",
  });
}

// 项目分类  - 查询考勤打卡列表
export function projectClassificationList(query) {
  return request({
    url: "/cld/attendance/projectClassificationList",
    method: "get",
    params: query,
  });
}

// 考勤统计  - 查询考勤打卡列表
export function selectAttendanceStatisticsList(query) {
  return request({
    url: "/cld/attendance/selectAttendanceStatisticsList",
    method: "get",
    params: query,
  });
}

// 查询考勤管理详细 - 表格形式
export function getTableCalendarList(query) {
  return request({
    url: "/cld/attendance/getTableCalendarList",
    method: "get",
    params: query,
  });
}

// 查询考勤管理详细 - 日历个人考勤一览
export function getCalendarByStaffId(query) {
  return request({
    url: "/cld/attendance/getCalendarByStaffId",
    method: "get",
    params: query,
  });
}
